In [2]:
%load_ext autoreload
%autoreload 2
from IPython.display import HTML
import vislab.datasets
import vislab._results
import os
In [3]:
def top_k_images(df, k=10):
return HTML(' '.join('<img src="{}" width="210px" />'.format(x) for x in df['image_url'].iloc[:k]))
In [63]:
# Flickr predictions, ground truth, and split info is all here.
results_df, preds_panel = aphrodite.results.load_pred_results(
'flickr_oct26', os.path.expanduser('~/work/aphrodite/data/results2'),
multiclass=False, force=False)
mc_pred_df = preds_panel.minor_xs('fusion_flickr_oct26 None vw')
Out[63]:
In [64]:
# PASCAL predictions
results_df, preds_panel = aphrodite.results.load_pred_results(
'pascal_on_flickr_oct29', os.path.expanduser('~/work/aphrodite/data/results2'),
multiclass=False, force=False)
content_pred_df = preds_panel.minor_xs('decaf_fc6 False vw')
content_pred_df.columns = [x.replace('clf flickr_', '') for x in content_pred_df.columns]
content_pred_df = content_pred_df.astype(float)
In [73]:
mc_pred_df = mc_pred_df.join(content_pred_df)
mc_pred_df['image_url'] = flickr_df['image_url']
flickr_df = mc_pred_df
In [74]:
# top cats
top_k_images(flickr_df.sort('class_cat', ascending=False))
Out[74]:
In [75]:
# ground truth bright, sorted by cat
top_k_images(flickr_df[flickr_df['style_Bright,_Energetic']].sort('class_cat', ascending=False))
Out[75]:
In [86]:
# cats sorted by bright
top_k_images(flickr_df.sort('class_cat', ascending=False).iloc[:1000].sort('pred_style_Bright,_Energetic', ascending=False))
Out[86]:
In [59]:
top_k_images(flickr_df[flickr_df['style_HDR']].sort('class_cat', ascending=False))
Out[59]:
In [46]:
top_k_images(flickr_df[flickr_df['style_Romantic']].sort('class_cat', ascending=False))
Out[46]:
In [47]:
top_k_images(flickr_df[flickr_df['style_Vintage']].sort('class_cat', ascending=False))
Out[47]:
In [48]:
top_k_images(flickr_df[flickr_df['style_Horror']].sort('class_cat', ascending=False))
Out[48]:
In [56]:
top_k_images(flickr_df[flickr_df['style_Melancholy']].sort('class_cat', ascending=False))
Out[56]:
In [18]:
results_df, preds_panel = vislab._results.load_pred_results(
'pascal_mc_on_wikipaintings_mar23', os.path.expanduser('~/work/aphrodite/data/results'),
multiclass=True, force=False)
content_pred_df = preds_panel.minor_xs('caffe_fc7 False vw')
In [19]:
label_df = vislab.datasets.wikipaintings.get_style_df()
df = content_pred_df.join(label_df)
In [21]:
top_k_images(df[df['style_Impressionism']].sort('pred_metaclass_animal', ascending=False))
Out[21]:
In [22]:
top_k_images(df[df['style_Impressionism']].sort('pred_metaclass_indoor', ascending=False))
Out[22]:
In [23]:
top_k_images(df[df['style_Impressionism']].sort('pred_metaclass_vehicle', ascending=False))
Out[23]:
In [24]:
top_k_images(df[df['style_Impressionism']].sort('pred_metaclass_person', ascending=False))
Out[24]: